import pymongo
from bson import ObjectId

handler = pymongo.MongoClient().qa_system.answer
answer = [
    {'author': '王小一',
     'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc23"),
     'answer': '毫无疑问，必定为2',
     'answer_time': '2018-07-23 12:18:11',
     'vote_up': 10,
     'vote_down': 200},
    {'author': '钱小九',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc23"),
         'answer': '楼上的，自问自答有意思吗？',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 100,
         'vote_down': 20},
    {'author': '孙小十',
     'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc23"),
     'answer': '在某些情况下可能等于三。题主应该补充必要信息。',
     'answer_time': '2018-07-23 12:18:11',
     'vote_up': 0,
     'vote_down': 100},
    {'author': '张若虚',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc26"),
         'answer': '这是我写的诗，下一句是：愿逐月华流照君。诗名为：《春江花月夜》',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 1000,
         'vote_down': 0},
    {'author': '阿东莫夫',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc24"),
         'answer': '这是阿西莫夫的《银河系漫游指南》里面的',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 20,
         'vote_down': 21},
    {'author': '道格拉斯',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc24"),
         'answer': '楼上的别乱说啊，《银河系漫游指南》是英国作家道格拉斯·亚当斯写的。',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 60,
         'vote_down': 10},
    {'author': '张起灵',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc24"),
         'answer': '是英国作家道格拉斯·亚当斯写的《银河系漫游指南》里面的原话。原因是42在ASCII码中对应了*号，而*号在通配符中代表一切',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 200,
         'vote_down': 1},
    {'author': '老司机',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc29"),
         'answer': '楼主，这不是去幼儿园的车！我只说作者是兰陵笑笑生，至于书名嘛，哈哈哈哈哈。',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 0,
         'vote_down': 100},
    {'author': '小文青',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc29"),
         'answer': '警察叔叔，这里有人在飙车。我认为兰陵笑笑生应该说王世贞。至于书名嘛，哈哈哈哈哈。',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 30,
         'vote_down': 0},
    {'author': '欧阳掏粪',
         'question_id': ObjectId("5b8b8fb9d3a25054b7a0dc29"),
         'answer': '《明朝那些事儿》里面讲了的，你去看看。',
         'answer_time': '2018-07-23 12:18:11',
         'vote_up': 40,
         'vote_down': 3},
]

handler.insert_many(answer)